//
//  MainRootController.m
//  CooperateTest
//
//  Created by administrator on 16/11/10.
//  Copyright © 2016年 duanzhenglong. All rights reserved.
//

#import "MainRootController.h"
#import "HomeController.h"
#import "ChatController.h"
#import "MeController.h"
@interface MainRootController ()

@end

@implementation MainRootController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupChildVc:[[HomeController alloc] init] title:@"主页"];
    [self setupChildVc:[[ChatController alloc] init] title:@"消息" ];
    [self setupChildVc:[[MeController alloc] init] title:@"我的" ];
}
#pragma mark-添加子控制器方法
-(void) setupChildVc:(UIViewController*)vc title:(NSString*)title{
    vc.tabBarItem.title=title;
    //添加为子控制器
    [self addChildViewController:vc];
}
@end
